From APRIL 1988 LAN TIMES, page 28. Fragments In Performance By John T. McCann Everyone wants more performance from a network. For personal computer (PC) users, defragmenting their hard disk might be a suitable remedy. But, if the same PC users, who have just turned LAN managers, attempt to defragment their network's shared disk, they'll find it difficult or impossible to locate such a utility for a NetWare network. WHAT'S A FRAGMENTED FILE? A file is called fragmented when it does not exist contiguously (in a sequential order) on a disk. Accessing a fragmented file means much time can be wasted waiting for the drive to position (move) the disk's heads to the next portion of the file. Higher disk performance is gained from disks that spend less time positioning their heads, resulting in a quicker response time and better system performance. On a standalone PC, higher disk performance is based on contiguously allocated files. Activity of the disk's heads is minimized to process (read or write) such files. Consequently, contiguously allocated files in a single-user system allow for the quickest file access. THE MULTIUSER DISK In a multiuser environment, contiguous files are most beneficial with single-user access. But unlike on a standalone, fragmented files on a shared hard disk are generally not a problem. To explain why this is not a problem, some common background needs to be established. REASONS FOR ACCESSING FILES There are two basic reasons to access files: for their entire content or for certain segments within the file. People who access files for their entire content are generally calling up programs, whether compilers, text editors, word processors, utilities, or applications. Some programs also need overlay, configuration, help, or driver files. Typically, these additional files are used when a program initially comes up. Word processing documents and spreadsheet data are additional examples of files that are accessed for their entire content. Users who need only file segments might be calling up database, index and non-database data files. File segments are accessed either sequentially or randomly. Users call up file segments much more often than they call up initial programs and their additional files. A multiuser system can experience fragmentation degradation if the system is using First-In-First-Out (FIFO) queue mechanisms to access files. FIFO mechanisms are DOS-like by nature and perform each read or write request in order of arrival at the file server, no matter how far removed the areas to be accessed are from each other. FIFO access in a multiuser system can also lead to hard disk thrashing. A disk that spends more time positioning its heads than accessing data is said to be thrashing. THE NETWARE SOLUTION NetWare minimizes thrashing by using an elevator-seeking mechanism that logically organizes disk operations as they arrive at the server for processing. As a consequence of elevator-seeking, the drive heads operate in a sweeping fashion, from one edge of the disk to the other. This intervention by NetWare ensures high throughput from the disk regardless of the amount of activity requested or the actual fragmentation of the files being accessed. In addition to elevator-seeking, NetWare also employs a caching mechanism. Caching stores in the server's memory the most recently read disk blocks (one disk block is 4KB). Caching also temporarily holds blocks to be written to disk. If the requested data exists in cache, no physical disk activity will occur to retrieve the data. Writing data to the cache minimizes the wait time for the user. Instead of waiting for the data to be written to the disk, the data is written to cache and users can continue their operations. Cache-stored data will be written to disk every three seconds, or when the entire cache buffer is updated. For example, if a file is being updated, NetWare would store the data in the cache. Once the data is in the cache, the application program continues because it thinks the data has been written to disk. And if data in the cache is needed for a read operation before it is written to disk, it will be read from the cache. NetWare speeds performance through elevator seeking and disk caching. The goal of elevator seeking is to reduce the amount of time spent positioning a disk's heads, while caching eliminates unnecessary disk access. Together, elevator seeking and caching diminish the effects of fragmentation in the NetWare environment. V2.1X FEATURES FAT INDEXING Elevator seeking and caching features are representative of all versions of Advanced NetWare. But, with the arrival of SFT NetWare v2.1, Novell is introducing a new feature to further decrease file access time. The new feature is File Allocation Table (FAT) indexing. The FAT is a singly linked list of pointers to disk blocks containing files. Further, the FAT is the device which resolves the logical-to-physical addresses needed to access files. FAT indexing decreases the time spent finding a specific FAT entry. Access to a certain FAT entry requires the sequential scanning of all entries previous to it. A file marked for FAT indexing (which is much like marking a file to be shareable) has a dynamically constructed index table containing pointers to that file. Using the index table, NetWare jumps instantly to the needed FAT entry (rather than scanning all previous FAT entries) on files containing no more than 512 4KB blocks or totalling no more than 2MB. If a file is initially greater than 2MB, or grows beyond 2MB, the indexed FAT dynamically begins to index every other FAT entry. Even though the file's size is greater than 2MB and the number of FAT entries pointed to by each index entry is increased, performance remains higher than sequential FAT access because the FAT index reduces sequential searches to a very small number. Up to 1,000 FAT index tables per server are allowed by SFT NetWare v2.1. Each FAT index table requires 1KB of memory at the server. FAT indexing is best implemented on files that are accessed for specific segments rather than files accessed for their entire content. (Files read for their content are read sequentially, the same way the FAT works.) SOME ALTERNATIVES If fragmented files on a NetWare or other network shared hard disk is still a concern, here are some salient areas to consider that are proven to increase network performance: ~ Add memory in the file server (more is better).* ~ Adjust the cache block size (with versions of NetWare v2.0a and below, cache block size can be changed; 4K block size is optimal for system speed but uses more memory).* ~ Increase the speed of the disk channel in the server (i.e., maybe add a DCB for 286 NetWare).* ~ Decrease the average access time of shared disk(s). ~ Increase the processing speed of network workstations. ~ Increase the number of network cards in the file server and split up the network cabling to decrease communication congestion between file server and workstations.* Performance can increase 10-fold or more by utilizing one or more of the above improveme nts. (The asterisks indicate NetWare-specific enhancements.) If none of these enhancements seem adequate, here is a method to defragment any disk: ~ Time certain activities utilizing the disk; maybe load a program, spreadsheet, etc. Try this with no other users logged on the system. ~ Back up the system completely, at least twice. (If it's a NetWare system, and not using v2.1, use some system other than Novell's internal tape unit to perform the backup and restore.) ~ CompSurf the disk in question. (If non-NetWare, reformat the specific disk.) ~ Re-install that disk into the system. ~ Restore the system. ~ Do the same time tests as before. ~ Ask the question, "Was it worth it?" The above steps were performed on several NetWare-shared hard disks and produced no noticeable increase in performance. The disks were all larger than 100MB and had been in service for more than a year before the test. The whole premise of fragmented files limiting performance is based on a single-user system, or a shared system that practices single-user disk access techniques (such as FIFO). The fact that a shared disk is in constant motion, due to multiuser access, supersedes the benefit of having files contiguously organized. Unless a file is processed for its entire content, the next time a file segment is processed, repositioning disk heads will most likely be necessary because the disk heads will probably have moved to service another user's request. Consequently, fragmented files have little effect on system performance in a shared disk environment. Through elevator seeking and caching, decreased performance of a NetWare system cannot be directly attributed to fragmented files. John T. McCann is the author of the Integrity Software's ANET Network Utilities and SiteLock and has installed over 500 NetWare systems in the past two and a half years. He is also the Wizard SysOp on NOVUSER NetWire, and can be reached at CompuServe ID 70007,3430 or 1-800-752-7001 x2807